<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        class Father {
            constructor(name, money, car) {
                this.name = name;
                this.money = money;
                this.car = car
            }

            drive() {
                alert(this.name + 'this guy can drive')
            }
        }

        class Son extends Father {
            constructor(name, money, bike) {
                super(name, money);
                this.bike = bike;
            }

            rideBike() {
                alert(this.name + 'this son can ride bike')
            }
        }

        class GrandSon extends Son {
            constructor(name, mike) {
                super(name);
                this.mike = mike;
            }

            eat() {
                alert(this.name + 'eat more grow more')
            }
        }


        let wsc = new GrandSon('wsc', 'mobike')
        wsc.drive()
        wsc.rideBike()
        wsc.eat()
        console.log(wsc)
    </script>
</body>

</html>